<template>
    <i class="iconfont icon-container" :class="fontClass"></i>
</template>

<script>
const classMap = {
    home: 'icon-home-g',
    success: "icon-zhengquewancheng-yuankuang",
    error: "icon-guanbishixin",
    close: "icon-guanbi",
    warn: "icon-jinggao",
    info: "icon-about",
    blog: "icon-bi",
    code: "icon-code",
    about: "icon-aboutus",
    weixin: "icon-logo-wechat",
    mail: "icon-mail4",
    github: "icon-github-fill",
    qq: "icon-QQ-circle-fill",
    arrowUp: "icon-xiangshang",
    arrowDown: "icon-xiangxia",
    empty: "icon-empty",
    chat: "icon-liuyan",
}
//测试代码
export const types = Object.keys(classMap);

export default {
    props:{
        type:{
            type: String,
            required: true,
        },
    },
    computed:{
        fontClass(){
            return classMap[this.type];
        }
    }
}
</script>

<style scoped>
    @import '//at.alicdn.com/t/c/font_4207240_6cij0wrdrc9.css';
    .iconfont{
        color: inherit;
        font-size: inherit;
    }
</style>